package Project;
//___________________________IMPORTACIONES______________________________________

import Validaciones.*;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import javax.swing.table.*;
//______________________________________________________________________________

public class IngresarVehiculo extends javax.swing.JPanel {
//_____________________________ATRIBUTOS________________________________________

    int Dialog;
    String sql;
//_____________________________CONSTRUCTOR______________________________________

    public IngresarVehiculo() {

        initComponents();
        String a = Container.lblPrivilegio.getText();

        if (a.equals("3")) {
            for (int i = 0; i < jPanel1.getComponents().length; i++) {
                jPanel1.getComponent(i).setEnabled(false);
            }
            btnVerTablaVehiculo.setEnabled(true);
            btnModificarVehiculo.setEnabled(false);
            btnEliminarVehiculo.setEnabled(false);
        }
        lblIdPropietario.setVisible(false);
        lblIdRuta.setVisible(false);
        lblIdTipo.setVisible(false);
        lblIdMarca.setVisible(false);
        lblIdConductor.setVisible(false);
        lblPlaca.setVisible(false);
        dlgCargandoDatos.setDefaultCloseOperation(0);

    }
//___________________________________METODOS____________________________________

    private void tamanoVehiculo() {

        int ancho = 1000;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaVehiculo.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaVehiculo.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 2:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 3:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 4:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 5:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 6:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 7:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 8:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 9:
                    anchoColumna = (20 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }
    }
//______________________________________________________________________________

    private void tamanoPropietarios() {

        int ancho = 816;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaPropietario.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaPropietario.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (30 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (30 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }

    }
//______________________________________________________________________________

    private void tamanoConductor() {

        int ancho = 816;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaConductor.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaConductor.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (30 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (30 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }

    }
//______________________________________________________________________________

    private void ocultarColumnas() {
        int i;
        for (i = 10; i < 15; i++) {
            tablaVehiculo.getColumnModel().getColumn(i).setMaxWidth(0);
            tablaVehiculo.getColumnModel().getColumn(i).setMinWidth(0);
            tablaVehiculo.getColumnModel().getColumn(i).setPreferredWidth(0);
            tablaVehiculo.getColumnModel().getColumn(i).setResizable(false);
        }
    }
//______________________________________________________________________________

    private void llenarVehiculo(String Valor) {

        BaseDeDatos.conectarse();

        try {

            String consulta = "SELECT propietario.nombre_completo, vehiculo.soat, ruta.ruta, tipo.tipo, vehiculo.modelo,"
                    + " vehiculo.placa, vehiculo.capacidad, marca.marca, conductor.nombre_completo, vehiculo.num_interno,"
                    + " vehiculo.ced_propietario, vehiculo.ruta_id, vehiculo.tipo_id, vehiculo.marca_id, vehiculo.ced_conductor AS vehiculo"
                    + " FROM vehiculo JOIN propietario ON (propietario.cedula = vehiculo.ced_propietario)"
                    + " JOIN ruta ON (ruta.id = vehiculo.ruta_id) JOIN tipo ON (tipo.id = vehiculo.tipo_id)"
                    + " JOIN marca ON (marca.id = vehiculo.marca_id) JOIN conductor ON (conductor.cedula = vehiculo.ced_conductor)";

            int valor_dos = cbxFiltrarVehiculo.getSelectedIndex();

            if (valor_dos == 0) {
                sql = consulta + " WHERE propietario.nombre_completo ILIKE '" + Valor + "%' ORDER BY propietario.nombre_completo";
            } else if (valor_dos == 1) {
                sql = consulta + " WHERE conductor.nombre_completo ILIKE '" + Valor + "%' ORDER BY propietario.nombre_completo";
            } else if (valor_dos == 2) {
                sql = consulta + " WHERE CAST(propietario.cedula AS CHAR(15)) LIKE '" + Valor + "%' ORDER BY propietario.nombre_completo";
            } else if (valor_dos == 3) {
                sql = consulta + " WHERE CAST(conductor.cedula AS CHAR(15)) LIKE '" + Valor + "%' ORDER BY propietario.nombre_completo";
            } else if (valor_dos == 4) {
                sql = consulta + " WHERE CAST(vehiculo.soat AS CHAR(15)) LIKE '" + Valor + "%' ORDER BY propietario.nombre_completo";
            } else if (valor_dos == 5) {
                sql = consulta + " WHERE vehiculo.placa ILIKE '" + Valor + "%' ORDER BY propietario.nombre_completo";
            } else if (valor_dos == 6) {
                sql = consulta + " WHERE CAST(vehiculo.num_interno AS CHAR(3)) LIKE '" + Valor + "%' ORDER BY propietario.nombre_completo";
            }

            DefaultTableModel modelo = new DefaultTableModel();
            tablaVehiculo.setModel(modelo);
            modelo.addColumn("PROPIETARIO");
            modelo.addColumn("N° SOAT");
            modelo.addColumn("RUTA");
            modelo.addColumn("TIPO");
            modelo.addColumn("MODELO");
            modelo.addColumn("PLACA");
            modelo.addColumn("CAPACIDAD");
            modelo.addColumn("MARCA");
            modelo.addColumn("CONDUCTOR");
            modelo.addColumn("NUMERO INTERNO");
            modelo.addColumn("PROPIETARIO CEDULA");
            modelo.addColumn("RUTA ID");
            modelo.addColumn("TIPO ID");
            modelo.addColumn("MARCA ID");
            modelo.addColumn("CONDUCTOR CEDULA");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[15]; // Hay 15 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 15; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaVehiculo.setModel(modelo);
            tamanoVehiculo();
            ocultarColumnas();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
//______________________________________________________________________________

    private void tamanoRutas() {

        int ancho = 489;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaRutas.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaRutas.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (100 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }

    }
//______________________________________________________________________________

    private void tamanoMarcas() {

        int ancho = 472;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaMarcas.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaMarcas.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (100 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }

    }
//______________________________________________________________________________

    private void tamanoTipos() {

        int ancho = 489;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaTipos.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaTipos.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (100 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }

    }
//______________________________________________________________________________

    private void llenarRutas() {

        BaseDeDatos.conectarse();

        try {

            sql = "select * from ruta order by id";

            DefaultTableModel modelo = new DefaultTableModel();
            tablaRutas.setModel(modelo);
            modelo.addColumn("ID");
            modelo.addColumn("RUTAS");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaRutas.setModel(modelo);
            tamanoRutas();
            tablaRutas.getColumnModel().getColumn(0).setMaxWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setMinWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setPreferredWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setResizable(false);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }

    }
//______________________________________________________________________________

    private void llenarPropietarios(String Valor) {

        BaseDeDatos.conectarse();

        try {

            int valor_dos = cbxFiltrarPropietario.getSelectedIndex();

            if (valor_dos == 0) {
                sql = "select nombre_completo, cedula from propietario where nombre ILIKE '" + Valor + "%' order by nombre_completo";
            } else if (valor_dos == 1) {
                sql = "SELECT nombre_completo, cedula FROM propietario WHERE CAST(cedula AS CHAR(15)) LIKE '" + Valor + "%' order by nombre_completo";
            }

            DefaultTableModel modelo = new DefaultTableModel();
            tablaPropietario.setModel(modelo);
            modelo.addColumn("NOMBRE");
            modelo.addColumn("CEDULA");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaPropietario.setModel(modelo);
            tamanoPropietarios();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
//______________________________________________________________________________

    private void llenarMarcas() {

        BaseDeDatos.conectarse();

        try {

            sql = "select * from marca order by id";

            DefaultTableModel modelo = new DefaultTableModel();
            tablaMarcas.setModel(modelo);
            modelo.addColumn("ID");
            modelo.addColumn("MARCAS");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaMarcas.setModel(modelo);
            tamanoMarcas();
            tablaMarcas.getColumnModel().getColumn(0).setMaxWidth(0);
            tablaMarcas.getColumnModel().getColumn(0).setMinWidth(0);
            tablaMarcas.getColumnModel().getColumn(0).setPreferredWidth(0);
            tablaMarcas.getColumnModel().getColumn(0).setResizable(false);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }

    }
//______________________________________________________________________________

    private void llenarTipos() {

        BaseDeDatos.conectarse();

        try {

            sql = "select * from tipo order by id";

            DefaultTableModel modelo = new DefaultTableModel();
            tablaTipos.setModel(modelo);
            modelo.addColumn("ID");
            modelo.addColumn("TIPOS");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaTipos.setModel(modelo);
            tamanoTipos();
            tablaTipos.getColumnModel().getColumn(0).setMaxWidth(0);
            tablaTipos.getColumnModel().getColumn(0).setMinWidth(0);
            tablaTipos.getColumnModel().getColumn(0).setPreferredWidth(0);
            tablaTipos.getColumnModel().getColumn(0).setResizable(false);

        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
//______________________________________________________________________________

    private void llenarConductores(String Valor) {

        BaseDeDatos.conectarse();

        try {

            int valor_dos = cbxFiltrarConductor.getSelectedIndex();

            if (valor_dos == 0) {
                sql = "SELECT nombre_completo, cedula FROM conductor WHERE nombre_completo ILIKE '" + Valor + "%' ORDER BY nombre_completo";
            } else if (valor_dos == 1) {
                sql = "SELECT nombre_completo, cedula FROM conductor WHERE CAST(cedula AS CHAR(15)) LIKE '" + Valor + "%' order by nombre_completo";
            }

            DefaultTableModel modelo = new DefaultTableModel();
            tablaConductor.setModel(modelo);
            modelo.addColumn("NOMBRE");
            modelo.addColumn("CEDULA");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaConductor.setModel(modelo);
            tamanoConductor();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }

    }
//______________________________________________________________________________

    private void insertarVehiculo() {

        BaseDeDatos.conectarse();
        if (txtPropietario.getText().equals("") || txtSoat.getText().equals("") || lblIdRuta.getText().equals("") || lblIdTipo.getText().equals("")
                || txtModelo.getText().equals("") || txtPlaca.getText().equals("") || lblIdMarca.getText().equals("") || txtCapacidad.getText().equals("")
                || lblIdConductor.getText().equals("") || txtNumeroInterno.getText().equals("")) {

            JOptionPane.showMessageDialog(null, "Hay Campos Vacios", "Error", JOptionPane.ERROR_MESSAGE);

        } else if (JOptionPane.showConfirmDialog(null, "Esta seguro de ingresar este nuevo registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                String c, h, g, i, e, f, a, d, b, j;

                c = lblIdPropietario.getText();
                h = txtSoat.getText();
                g = lblIdRuta.getText();
                i = lblIdTipo.getText();
                e = txtModelo.getText();
                f = txtPlaca.getText();
                a = txtCapacidad.getText();
                d = lblIdMarca.getText();
                b = lblIdConductor.getText();
                j = txtNumeroInterno.getText();

                sql = "insert into vehiculo values (" + c + "," + h + "," + g + "," + i + "," + e + ",'" + f.toUpperCase() + "',"
                        + "" + a + "," + d + "," + b + "," + j + ")";
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro se agrego de manera exitosa", "Info", JOptionPane.INFORMATION_MESSAGE);

                    txtPropietario.setText("");
                    txtSoat.setText("");
                    txtRuta.setText("");
                    txtTipo.setText("");
                    txtModelo.setText("");
                    txtPlaca.setText("");
                    txtMarca.setText("");
                    txtCapacidad.setText("");
                    txtConductor.setText("");
                    lblIdConductor.setText("");
                    lblIdMarca.setText("");
                    lblIdTipo.setText("");
                    lblIdRuta.setText("");
                    lblIdPropietario.setText("");
                    txtNumeroInterno.setText("");
                    txtConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
                    txtMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
                    txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
                    txtTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));

                }
            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarVehiculo("");

    }
//______________________________________________________________________________

    private void eliminarVehiculo() {

        BaseDeDatos.conectarse();
        if (tablaVehiculo.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea eliminar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {
                lblPlaca.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 5));
                String d = lblPlaca.getText();
                sql = "delete  from vehiculo where placa='" + d + "'";
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido eliminado", "Info", JOptionPane.INFORMATION_MESSAGE);
                    lblPlaca.setText("");
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo borrar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarVehiculo("");
    }
//______________________________________________________________________________

    private void modificarVehiculo() {

        BaseDeDatos.conectarse();
        if (tablaVehiculo.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea modificar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                String p, c, h, g, i, e, f, d, a, b, j;

                p = lblPlaca.getText();
                c = lblIdPropietario.getText();
                h = txtNuevoSoat.getText();
                g = lblIdRuta.getText();
                i = lblIdTipo.getText();
                e = txtNuevoModelo.getText();
                f = txtNuevaPlaca.getText();
                a = txtNuevaCapacidad.getText();
                d = lblIdMarca.getText();
                b = lblIdConductor.getText();
                j = txtNuevoNumeroInterno.getText();

                sql = "update vehiculo set ced_propietario=" + c + ", soat=" + h + ", ruta_id=" + g + ", tipo_id="
                        + i + ", modelo=" + e + ", placa='" + f.toUpperCase() + "', capacidad=" + a + ", marca_id="
                        + d + ", ced_conductor=" + b + ", num_interno=" + j + " where placa='" + p + "'";

                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido modificado exitosamente", "Info", JOptionPane.INFORMATION_MESSAGE);

                    lblPlaca.setText("");
                    lblIdTipo.setText("");
                    lblIdRuta.setText("");
                    lblIdMarca.setText("");
                    txtNuevoSoat.setText("");
                    txtNuevaRuta.setText("");
                    txtNuevoTipo.setText("");
                    txtNuevaMarca.setText("");
                    txtNuevaPlaca.setText("");
                    lblIdConductor.setText("");
                    txtNuevoModelo.setText("");
                    lblIdPropietario.setText("");
                    txtNuevaCapacidad.setText("");
                    txtNuevoConductor.setText("");
                    txtNuevoPropietario.setText("");
                    txtNuevoNumeroInterno.setText("");
                    txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
                    txtNuevaMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
                    txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
                    txtNuevoTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
                    dlgModificarVehiculo.setVisible(false);

                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, e.getMessage() + "El registro no se pudo  modificar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarVehiculo("");
    }
//______________________________________________________________________________

    private void btnModificar() {
        if (tablaVehiculo.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            lblIdPropietario.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 10));
            lblIdRuta.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 11));
            lblIdTipo.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 12));
            lblIdMarca.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 13));
            lblIdConductor.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 14));
            lblPlaca.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 5));
            txtNuevoPropietario.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 0));
            txtNuevoSoat.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 1));
            txtNuevaRuta.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 2));
            txtNuevoTipo.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 3));
            txtNuevoModelo.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 4));
            txtNuevaPlaca.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 5));
            txtNuevaCapacidad.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 6));
            txtNuevaMarca.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 7));
            txtNuevoConductor.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 8));
            txtNuevoNumeroInterno.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 9));
            txtNuevoPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            txtNuevoTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            txtNuevaMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            dlgModificarVehiculo.setLocationRelativeTo(null);
            dlgModificarVehiculo.setVisible(true);
        }
    }
//______________________________________________________________________________

    public class hiloRutas implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarRutas();
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgRuta.setLocationRelativeTo(null);
                        dlgRuta.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloMarcas implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarMarcas();
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgMarca.setLocationRelativeTo(null);
                        dlgMarca.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloTipos implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarTipos();
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgTipo.setLocationRelativeTo(null);
                        dlgTipo.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloPropietarios implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarPropietarios("");
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgPropietario.setLocationRelativeTo(null);
                        dlgPropietario.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloConductores implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarConductores("");
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgConductor.setLocationRelativeTo(null);
                        dlgConductor.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloVehiculos implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarVehiculo("");
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgTablaVehiculo.setLocationRelativeTo(null);
                        dlgTablaVehiculo.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dlgTablaVehiculo = new javax.swing.JDialog();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tablaVehiculo = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnEliminarVehiculo = new javax.swing.JButton();
        btnModificarVehiculo = new javax.swing.JButton();
        lblPlaca = new javax.swing.JLabel();
        Buscar = new javax.swing.JLabel();
        txtBuscarVehiculo = new javax.swing.JTextField();
        cbxFiltrarVehiculo = new javax.swing.JComboBox();
        dlgRuta = new javax.swing.JDialog();
        jPanel3 = new javax.swing.JPanel();
        btnAceptarRuta = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tablaRutas = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnRutaDos = new javax.swing.JButton();
        dlgTipo = new javax.swing.JDialog();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tablaTipos = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnAceptarTipo = new javax.swing.JButton();
        btnTipoDos = new javax.swing.JButton();
        dlgMarca = new javax.swing.JDialog();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        tablaMarcas = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnAceptarMarca = new javax.swing.JButton();
        btnMarcaDos = new javax.swing.JButton();
        dlgConductor = new javax.swing.JDialog();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        tablaConductor = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnAceptarConductor = new javax.swing.JButton();
        btnConductorDos = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        txtBuscarConductor = new javax.swing.JTextField();
        cbxFiltrarConductor = new javax.swing.JComboBox();
        dlgModificarVehiculo = new javax.swing.JDialog();
        jPanel9 = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        txtNuevaPlaca = new javax.swing.JTextField();
        txtNuevoModelo = new javax.swing.JTextField();
        txtNuevoTipo = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        txtNuevoConductor = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        txtNuevoPropietario = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        txtNuevaMarca = new javax.swing.JTextField();
        txtNuevoSoat = new javax.swing.JTextField();
        txtNuevaCapacidad = new javax.swing.JTextField();
        txtNuevaRuta = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        btnAceptar = new javax.swing.JButton();
        SeleccionarTipo = new javax.swing.JButton();
        SeleccionarRuta = new javax.swing.JButton();
        SeleccionarMarca = new javax.swing.JButton();
        SeleccionarConductor = new javax.swing.JButton();
        jLabel23 = new javax.swing.JLabel();
        txtNuevoNumeroInterno = new javax.swing.JTextField();
        SeleccionarPropietario = new javax.swing.JButton();
        dlgPropietario = new javax.swing.JDialog();
        jPanel8 = new javax.swing.JPanel();
        btnAceptarPropietario = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        tablaPropietario = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        jLabel2 = new javax.swing.JLabel();
        txtBuscarPropietario = new javax.swing.JTextField();
        btnPropietarioDos = new javax.swing.JButton();
        cbxFiltrarPropietario = new javax.swing.JComboBox();
        dlgCargandoDatos = new javax.swing.JDialog();
        pbCargarDatos = new javax.swing.JProgressBar();
        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        txtPropietario = new javax.swing.JTextField();
        txtSoat = new javax.swing.JTextField();
        txtModelo = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        txtPlaca = new javax.swing.JTextField();
        txtCapacidad = new javax.swing.JTextField();
        btnIngresarVehiculo = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        btnSeleccionarConductor = new javax.swing.JButton();
        btnVerTablaVehiculo = new javax.swing.JButton();
        btnSelecionarRuta = new javax.swing.JButton();
        btnSeleccionarTipo = new javax.swing.JButton();
        btnSeleccionarMarca = new javax.swing.JButton();
        txtRuta = new javax.swing.JTextField();
        txtTipo = new javax.swing.JTextField();
        txtMarca = new javax.swing.JTextField();
        txtConductor = new javax.swing.JTextField();
        lblIdRuta = new javax.swing.JLabel();
        lblIdTipo = new javax.swing.JLabel();
        lblIdMarca = new javax.swing.JLabel();
        lblIdConductor = new javax.swing.JLabel();
        btnSeleccionarPropietario = new javax.swing.JButton();
        jLabel22 = new javax.swing.JLabel();
        txtNumeroInterno = new javax.swing.JTextField();
        lblIdPropietario = new javax.swing.JLabel();

        dlgTablaVehiculo.setTitle("Vehiculos");
        dlgTablaVehiculo.setMinimumSize(new java.awt.Dimension(795, 561));
        dlgTablaVehiculo.setModal(true);
        dlgTablaVehiculo.setResizable(false);

        jPanel2.setMaximumSize(new java.awt.Dimension(775, 494));
        jPanel2.setMinimumSize(new java.awt.Dimension(775, 494));

        tablaVehiculo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaVehiculo.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaVehiculo.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaVehiculo.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        tablaVehiculo.setMinimumSize(new java.awt.Dimension(750, 0));
        tablaVehiculo.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(tablaVehiculo);

        btnEliminarVehiculo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnEliminarVehiculo.setText("Eliminar");
        btnEliminarVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnEliminarVehiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarVehiculoActionPerformed(evt);
            }
        });

        btnModificarVehiculo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnModificarVehiculo.setText("Modificar");
        btnModificarVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnModificarVehiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarVehiculoActionPerformed(evt);
            }
        });

        lblPlaca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        Buscar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        Buscar.setText("Filtrar por:");

        txtBuscarVehiculo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtBuscarVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtBuscarVehiculo.setMargin(new java.awt.Insets(0, 5, 0, 5));
        txtBuscarVehiculo.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtBuscarVehiculoKeyReleased(evt);
            }
        });

        cbxFiltrarVehiculo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxFiltrarVehiculo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Nombre Propietario", "Nombre Conductor", "Cedula Propietario", "CedulaConductor", "N° SOAT", "Placa", "N° Interno" }));
        cbxFiltrarVehiculo.setSelectedIndex(5);
        cbxFiltrarVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(btnEliminarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnModificarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 521, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(Buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(cbxFiltrarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(txtBuscarVehiculo, javax.swing.GroupLayout.DEFAULT_SIZE, 536, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBuscarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxFiltrarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 446, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnEliminarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnModificarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgTablaVehiculoLayout = new javax.swing.GroupLayout(dlgTablaVehiculo.getContentPane());
        dlgTablaVehiculo.getContentPane().setLayout(dlgTablaVehiculoLayout);
        dlgTablaVehiculoLayout.setHorizontalGroup(
            dlgTablaVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgTablaVehiculoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgTablaVehiculoLayout.setVerticalGroup(
            dlgTablaVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgTablaVehiculoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgRuta.setTitle("Rutas");
        dlgRuta.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgRuta.setModal(true);
        dlgRuta.setResizable(false);

        btnAceptarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarRuta.setText("Aceptar");
        btnAceptarRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnAceptarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarRutaActionPerformed(evt);
            }
        });

        tablaRutas.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaRutas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaRutas.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaRutas.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(tablaRutas);

        btnRutaDos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnRutaDos.setText("Aceptar");
        btnRutaDos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnRutaDos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRutaDosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(btnAceptarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnRutaDos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 277, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnAceptarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnRutaDos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgRutaLayout = new javax.swing.GroupLayout(dlgRuta.getContentPane());
        dlgRuta.getContentPane().setLayout(dlgRutaLayout);
        dlgRutaLayout.setHorizontalGroup(
            dlgRutaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgRutaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgRutaLayout.setVerticalGroup(
            dlgRutaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgRutaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgTipo.setTitle("Tipos de Vehiculos");
        dlgTipo.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgTipo.setModal(true);
        dlgTipo.setResizable(false);

        tablaTipos.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaTipos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaTipos.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaTipos.getTableHeader().setReorderingAllowed(false);
        jScrollPane3.setViewportView(tablaTipos);

        btnAceptarTipo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarTipo.setText("Aceptar");
        btnAceptarTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnAceptarTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarTipoActionPerformed(evt);
            }
        });

        btnTipoDos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnTipoDos.setText("Aceptar");
        btnTipoDos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnTipoDos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTipoDosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(btnAceptarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnTipoDos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 277, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAceptarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnTipoDos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgTipoLayout = new javax.swing.GroupLayout(dlgTipo.getContentPane());
        dlgTipo.getContentPane().setLayout(dlgTipoLayout);
        dlgTipoLayout.setHorizontalGroup(
            dlgTipoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgTipoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgTipoLayout.setVerticalGroup(
            dlgTipoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgTipoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgMarca.setTitle("Marcas");
        dlgMarca.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgMarca.setModal(true);
        dlgMarca.setResizable(false);

        tablaMarcas.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaMarcas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaMarcas.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaMarcas.getTableHeader().setReorderingAllowed(false);
        jScrollPane4.setViewportView(tablaMarcas);

        btnAceptarMarca.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarMarca.setText("Aceptar");
        btnAceptarMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnAceptarMarca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarMarcaActionPerformed(evt);
            }
        });

        btnMarcaDos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnMarcaDos.setText("Aceptar");
        btnMarcaDos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnMarcaDos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMarcaDosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(btnAceptarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnMarcaDos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAceptarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnMarcaDos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgMarcaLayout = new javax.swing.GroupLayout(dlgMarca.getContentPane());
        dlgMarca.getContentPane().setLayout(dlgMarcaLayout);
        dlgMarcaLayout.setHorizontalGroup(
            dlgMarcaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgMarcaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgMarcaLayout.setVerticalGroup(
            dlgMarcaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgMarcaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgConductor.setTitle("Conductores");
        dlgConductor.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgConductor.setModal(true);
        dlgConductor.setResizable(false);

        tablaConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaConductor.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaConductor.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaConductor.setMaximumSize(new java.awt.Dimension(375, 0));
        tablaConductor.setMinimumSize(new java.awt.Dimension(375, 0));
        tablaConductor.getTableHeader().setReorderingAllowed(false);
        jScrollPane5.setViewportView(tablaConductor);

        btnAceptarConductor.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarConductor.setText("Aceptar");
        btnAceptarConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnAceptarConductor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarConductorActionPerformed(evt);
            }
        });

        btnConductorDos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnConductorDos.setText("Aceptar");
        btnConductorDos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnConductorDos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConductorDosActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel3.setText("Filtrar por:");

        txtBuscarConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtBuscarConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtBuscarConductor.setMargin(new java.awt.Insets(0, 5, 0, 5));
        txtBuscarConductor.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtBuscarConductorKeyReleased(evt);
            }
        });

        cbxFiltrarConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxFiltrarConductor.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Nombre", "Cedula" }));
        cbxFiltrarConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxFiltrarConductor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbxFiltrarConductorActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(btnAceptarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(4, 4, 4)
                        .addComponent(btnConductorDos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cbxFiltrarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtBuscarConductor)))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBuscarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxFiltrarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
                .addGap(11, 11, 11)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAceptarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnConductorDos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5))
        );

        javax.swing.GroupLayout dlgConductorLayout = new javax.swing.GroupLayout(dlgConductor.getContentPane());
        dlgConductor.getContentPane().setLayout(dlgConductorLayout);
        dlgConductorLayout.setHorizontalGroup(
            dlgConductorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgConductorLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgConductorLayout.setVerticalGroup(
            dlgConductorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgConductorLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgModificarVehiculo.setTitle("Modificar Vehiculo");
        dlgModificarVehiculo.setMinimumSize(new java.awt.Dimension(432, 494));
        dlgModificarVehiculo.setModal(true);
        dlgModificarVehiculo.setResizable(false);

        jLabel18.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel18.setText("Placa:");

        txtNuevaPlaca.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaPlaca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevaPlaca.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtNuevoModelo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoModelo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevoModelo.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtNuevoTipo.setEditable(false);
        txtNuevoTipo.setBackground(new java.awt.Color(255, 255, 255));
        txtNuevoTipo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevoTipo.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel16.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel16.setText("Tipo:");

        jLabel17.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel17.setText("Modelo:");

        txtNuevoConductor.setEditable(false);
        txtNuevoConductor.setBackground(new java.awt.Color(255, 255, 255));
        txtNuevoConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoConductor.setAutoscrolls(false);
        txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevoConductor.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel14.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel14.setText("N° SOAT:");
        jLabel14.setToolTipText("");

        txtNuevoPropietario.setEditable(false);
        txtNuevoPropietario.setBackground(new java.awt.Color(255, 255, 255));
        txtNuevoPropietario.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevoPropietario.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel15.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel15.setText("Ruta:");
        jLabel15.setToolTipText("");

        txtNuevaMarca.setEditable(false);
        txtNuevaMarca.setBackground(new java.awt.Color(255, 255, 255));
        txtNuevaMarca.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevaMarca.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtNuevoSoat.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoSoat.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevoSoat.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtNuevaCapacidad.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaCapacidad.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevaCapacidad.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtNuevaRuta.setEditable(false);
        txtNuevaRuta.setBackground(new java.awt.Color(255, 255, 255));
        txtNuevaRuta.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevaRuta.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel13.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel13.setText("Propietario:");

        jLabel19.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel19.setText("Marca:");

        jLabel20.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel20.setText("Capacidad:");

        jLabel21.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel21.setText("Conductor:");

        btnAceptar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptar.setText("Aceptar");
        btnAceptar.setBorder(null);
        btnAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarActionPerformed(evt);
            }
        });

        SeleccionarTipo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        SeleccionarTipo.setText("Seleccionar");
        SeleccionarTipo.setBorder(null);
        SeleccionarTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SeleccionarTipoActionPerformed(evt);
            }
        });

        SeleccionarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        SeleccionarRuta.setText("Seleccionar");
        SeleccionarRuta.setBorder(null);
        SeleccionarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SeleccionarRutaActionPerformed(evt);
            }
        });

        SeleccionarMarca.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        SeleccionarMarca.setText("Seleccionar");
        SeleccionarMarca.setBorder(null);
        SeleccionarMarca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SeleccionarMarcaActionPerformed(evt);
            }
        });

        SeleccionarConductor.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        SeleccionarConductor.setText("Seleccionar");
        SeleccionarConductor.setBorder(null);
        SeleccionarConductor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SeleccionarConductorActionPerformed(evt);
            }
        });

        jLabel23.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel23.setText("Numero interno:");

        txtNuevoNumeroInterno.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoNumeroInterno.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevoNumeroInterno.setMargin(new java.awt.Insets(0, 5, 0, 5));

        SeleccionarPropietario.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        SeleccionarPropietario.setText("Seleccionar");
        SeleccionarPropietario.setBorder(null);
        SeleccionarPropietario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SeleccionarPropietarioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtNuevoNumeroInterno, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 213, Short.MAX_VALUE))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel17, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                        .addComponent(txtNuevoPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(5, 5, 5)
                                        .addComponent(SeleccionarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(txtNuevaPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtNuevaCapacidad, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtNuevoSoat, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txtNuevaRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtNuevoTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtNuevoModelo, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(5, 5, 5)
                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(SeleccionarTipo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(SeleccionarRuta, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                            .addComponent(btnAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jLabel19, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                        .addComponent(txtNuevaMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(5, 5, 5)
                                        .addComponent(SeleccionarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                        .addComponent(txtNuevoConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(5, 5, 5)
                                        .addComponent(SeleccionarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addContainerGap(20, Short.MAX_VALUE))))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SeleccionarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoSoat, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevaRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SeleccionarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SeleccionarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoModelo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevaPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevaCapacidad, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevaMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SeleccionarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SeleccionarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoNumeroInterno, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addComponent(btnAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(13, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dlgModificarVehiculoLayout = new javax.swing.GroupLayout(dlgModificarVehiculo.getContentPane());
        dlgModificarVehiculo.getContentPane().setLayout(dlgModificarVehiculoLayout);
        dlgModificarVehiculoLayout.setHorizontalGroup(
            dlgModificarVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarVehiculoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgModificarVehiculoLayout.setVerticalGroup(
            dlgModificarVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarVehiculoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(30, 30, 30))
        );

        dlgPropietario.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        dlgPropietario.setTitle("Propietarios");
        dlgPropietario.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgPropietario.setModal(true);
        dlgPropietario.setResizable(false);

        btnAceptarPropietario.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarPropietario.setText("Aceptar");
        btnAceptarPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnAceptarPropietario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarPropietarioActionPerformed(evt);
            }
        });

        tablaPropietario.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaPropietario.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaPropietario.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaPropietario.getTableHeader().setReorderingAllowed(false);
        jScrollPane6.setViewportView(tablaPropietario);

        jLabel2.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel2.setText("Filtrar por:");

        txtBuscarPropietario.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtBuscarPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtBuscarPropietario.setMargin(new java.awt.Insets(0, 5, 0, 5));
        txtBuscarPropietario.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtBuscarPropietarioKeyReleased(evt);
            }
        });

        btnPropietarioDos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnPropietarioDos.setText("Aceptar");
        btnPropietarioDos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnPropietarioDos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPropietarioDosActionPerformed(evt);
            }
        });

        cbxFiltrarPropietario.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxFiltrarPropietario.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Nombre", "Cedula" }));
        cbxFiltrarPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxFiltrarPropietario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbxFiltrarPropietarioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(btnAceptarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnPropietarioDos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(cbxFiltrarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(txtBuscarPropietario)))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBuscarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxFiltrarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnAceptarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPropietarioDos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgPropietarioLayout = new javax.swing.GroupLayout(dlgPropietario.getContentPane());
        dlgPropietario.getContentPane().setLayout(dlgPropietarioLayout);
        dlgPropietarioLayout.setHorizontalGroup(
            dlgPropietarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgPropietarioLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgPropietarioLayout.setVerticalGroup(
            dlgPropietarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgPropietarioLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgCargandoDatos.setTitle("Cargando Datos...");
        dlgCargandoDatos.setMinimumSize(new java.awt.Dimension(267, 72));
        dlgCargandoDatos.setModal(true);
        dlgCargandoDatos.setResizable(false);

        pbCargarDatos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout dlgCargandoDatosLayout = new javax.swing.GroupLayout(dlgCargandoDatos.getContentPane());
        dlgCargandoDatos.getContentPane().setLayout(dlgCargandoDatosLayout);
        dlgCargandoDatosLayout.setHorizontalGroup(
            dlgCargandoDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgCargandoDatosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pbCargarDatos, javax.swing.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgCargandoDatosLayout.setVerticalGroup(
            dlgCargandoDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgCargandoDatosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pbCargarDatos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(37, Short.MAX_VALUE))
        );

        setMaximumSize(new java.awt.Dimension(973, 662));
        setMinimumSize(new java.awt.Dimension(973, 662));
        setPreferredSize(new java.awt.Dimension(973, 662));

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/logo.png"))); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Ingresar Nuevo Vehiculo", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 14))); // NOI18N
        jPanel1.setMaximumSize(new java.awt.Dimension(953, 503));
        jPanel1.setMinimumSize(new java.awt.Dimension(953, 503));
        jPanel1.setPreferredSize(new java.awt.Dimension(953, 503));

        jLabel4.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel4.setText("Propietario:");

        jLabel5.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel5.setText("N° SOAT:");

        jLabel6.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel6.setText("Ruta:");

        jLabel7.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel7.setText("Tipo:");

        jLabel8.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel8.setText("Modelo:");

        jLabel9.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel9.setText("Marca:");

        jLabel10.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel10.setText("Capacidad:");

        txtPropietario.setEditable(false);
        txtPropietario.setEditable(false);
        txtPropietario.setBackground(new java.awt.Color(255, 255, 255));
        txtPropietario.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 51, 51)));
        txtPropietario.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtSoat.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtSoat.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtSoat.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtModelo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtModelo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtModelo.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel11.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel11.setText("Placa:");

        txtPlaca.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtPlaca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtPlaca.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtCapacidad.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtCapacidad.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtCapacidad.setMargin(new java.awt.Insets(0, 5, 0, 5));

        btnIngresarVehiculo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnIngresarVehiculo.setText("Ingresar");
        btnIngresarVehiculo.setBorder(null);
        btnIngresarVehiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIngresarVehiculoActionPerformed(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel12.setText("Conductor:");

        btnSeleccionarConductor.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnSeleccionarConductor.setText("Seleccionar");
        btnSeleccionarConductor.setBorder(null);
        btnSeleccionarConductor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSeleccionarConductorActionPerformed(evt);
            }
        });

        btnVerTablaVehiculo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnVerTablaVehiculo.setText("Ver Tabla");
        btnVerTablaVehiculo.setBorder(null);
        btnVerTablaVehiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVerTablaVehiculoActionPerformed(evt);
            }
        });

        btnSelecionarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnSelecionarRuta.setText("Seleccionar");
        btnSelecionarRuta.setBorder(null);
        btnSelecionarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSelecionarRutaActionPerformed(evt);
            }
        });

        btnSeleccionarTipo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnSeleccionarTipo.setText("Seleccionar");
        btnSeleccionarTipo.setBorder(null);
        btnSeleccionarTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSeleccionarTipoActionPerformed(evt);
            }
        });

        btnSeleccionarMarca.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnSeleccionarMarca.setText("Seleccionar");
        btnSeleccionarMarca.setBorder(null);
        btnSeleccionarMarca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSeleccionarMarcaActionPerformed(evt);
            }
        });

        txtRuta.setEditable(false);
        txtRuta.setBackground(new java.awt.Color(255, 255, 255));
        txtRuta.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 51, 51)));
        txtRuta.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtTipo.setEditable(false);
        txtTipo.setBackground(new java.awt.Color(255, 255, 255));
        txtTipo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 51, 51)));
        txtTipo.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtMarca.setEditable(false);
        txtMarca.setBackground(new java.awt.Color(255, 255, 255));
        txtMarca.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 51, 51)));
        txtMarca.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtConductor.setEditable(false);
        txtConductor.setBackground(new java.awt.Color(255, 255, 255));
        txtConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 51, 51)));
        txtConductor.setMargin(new java.awt.Insets(0, 5, 0, 5));

        lblIdRuta.setToolTipText("");
        lblIdRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblIdTipo.setToolTipText("");
        lblIdTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblIdMarca.setToolTipText("");
        lblIdMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblIdConductor.setToolTipText("");
        lblIdConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnSeleccionarPropietario.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnSeleccionarPropietario.setText("Seleccionar");
        btnSeleccionarPropietario.setBorder(null);
        btnSeleccionarPropietario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSeleccionarPropietarioActionPerformed(evt);
            }
        });

        jLabel22.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel22.setText("Numero interno:");

        txtNumeroInterno.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNumeroInterno.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNumeroInterno.setMargin(new java.awt.Insets(0, 5, 0, 5));

        lblIdPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(283, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(btnIngresarVehiculo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                                .addGap(6, 6, 6)))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtNumeroInterno, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(btnVerTablaVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblIdPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblIdRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblIdTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblIdMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblIdConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtCapacidad, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(txtMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(5, 5, 5)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(btnSeleccionarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnSeleccionarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(txtPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(5, 5, 5)
                                .addComponent(btnSeleccionarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(txtModelo, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(txtSoat)
                                    .addComponent(txtRuta, javax.swing.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE))
                                .addGap(5, 5, 5)
                                .addComponent(btnSelecionarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(5, 5, 5)
                        .addComponent(btnSeleccionarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(283, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSeleccionarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtSoat, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSelecionarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSeleccionarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtModelo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCapacidad, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSeleccionarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(btnSeleccionarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(txtConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNumeroInterno, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(btnIngresarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(btnVerTablaVehiculo, javax.swing.GroupLayout.DEFAULT_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblIdRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblIdTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblIdMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblIdConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(lblIdPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(49, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 508, Short.MAX_VALUE)
                .addGap(5, 5, 5))
        );
    }// </editor-fold>//GEN-END:initComponents
//______________________________________________________________________________

    private void btnVerTablaVehiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerTablaVehiculoActionPerformed

        new Thread(new hiloVehiculos()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        tablaVehiculo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaVehiculo.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnVerTablaVehiculoActionPerformed
//______________________________________________________________________________

    private void btnSelecionarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSelecionarRutaActionPerformed

        new Thread(new hiloRutas()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarRuta.setVisible(true);
        btnRutaDos.setVisible(false);
        tablaRutas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaRutas.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnSelecionarRutaActionPerformed
//______________________________________________________________________________

    private void btnSeleccionarTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarTipoActionPerformed

        new Thread(new hiloTipos()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarTipo.setVisible(true);
        btnTipoDos.setVisible(false);
        tablaTipos.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaTipos.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnSeleccionarTipoActionPerformed
//______________________________________________________________________________

    private void btnSeleccionarMarcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarMarcaActionPerformed

        new Thread(new hiloMarcas()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarMarca.setVisible(true);
        btnMarcaDos.setVisible(false);
        tablaMarcas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaMarcas.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnSeleccionarMarcaActionPerformed
//______________________________________________________________________________

    private void btnSeleccionarConductorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarConductorActionPerformed

        new Thread(new hiloConductores()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarConductor.setVisible(true);
        btnConductorDos.setVisible(false);
        tablaConductor.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaConductor.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnSeleccionarConductorActionPerformed
//______________________________________________________________________________

    private void btnAceptarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarRutaActionPerformed

        if (tablaRutas.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 1));
            lblIdRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 0));

            if (txtRuta.getText().equals("")) {
                txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgRuta.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnAceptarRutaActionPerformed
//______________________________________________________________________________

    private void btnAceptarTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarTipoActionPerformed

        if (tablaTipos.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtTipo.setText("" + tablaTipos.getValueAt(tablaTipos.getSelectedRow(), 1));
            lblIdTipo.setText("" + tablaTipos.getValueAt(tablaTipos.getSelectedRow(), 0));

            if (txtTipo.getText().equals("")) {
                txtTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgTipo.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnAceptarTipoActionPerformed
//______________________________________________________________________________

    private void btnAceptarMarcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarMarcaActionPerformed

        if (tablaMarcas.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtMarca.setText("" + tablaMarcas.getValueAt(tablaMarcas.getSelectedRow(), 1));
            lblIdMarca.setText("" + tablaMarcas.getValueAt(tablaMarcas.getSelectedRow(), 0));

            if (txtMarca.getText().equals("")) {
                txtMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgMarca.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnAceptarMarcaActionPerformed
//______________________________________________________________________________

    private void btnAceptarConductorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarConductorActionPerformed

        if (tablaConductor.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtConductor.setText("" + tablaConductor.getValueAt(tablaConductor.getSelectedRow(), 0));
            lblIdConductor.setText("" + tablaConductor.getValueAt(tablaConductor.getSelectedRow(), 1));

            if (txtConductor.getText().equals("")) {
                txtConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgConductor.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnAceptarConductorActionPerformed
//______________________________________________________________________________

    private void btnIngresarVehiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIngresarVehiculoActionPerformed

        String propietario, soat, ruta, tipo, modelo, placa, capacidad, marca, conductor, numeroInterno;
        propietario = txtPropietario.getText();
        soat = txtSoat.getText();
        ruta = txtRuta.getText();
        tipo = txtTipo.getText();
        modelo = txtModelo.getText();
        placa = txtPlaca.getText();
        capacidad = txtCapacidad.getText();
        marca = txtMarca.getText();
        conductor = txtConductor.getText();
        numeroInterno = txtNumeroInterno.getText();
        boolean valida = true;

        while (valida) {
            if (ValidacionesVehiculo.validaPropietario(propietario, txtPropietario) || ValidacionesVehiculo.validaSoat(soat, txtSoat) || ValidacionesVehiculo.validaRuta(ruta, txtRuta)
                    || ValidacionesVehiculo.validaTipo(tipo, txtTipo) || ValidacionesVehiculo.validaModelo(modelo, txtModelo) || ValidacionesVehiculo.validaPlaca(placa, txtPlaca)
                    || ValidacionesVehiculo.validaCapacidad(capacidad, txtCapacidad) || ValidacionesVehiculo.validaMarca(marca, txtMarca) || ValidacionesVehiculo.validaConductor(conductor, txtConductor)
                    || ValidacionesVehiculo.validaNumeroInterno(numeroInterno, txtNumeroInterno)) {
                JOptionPane.showMessageDialog(jPanel1, "Por favor verifique los datos", "Error", JOptionPane.ERROR_MESSAGE);
            } else {
                insertarVehiculo();
                ValidacionesAccidentes.pintarNegro(txtPropietario);
                ValidacionesAccidentes.pintarNegro(txtSoat);
                ValidacionesAccidentes.pintarNegro(txtRuta);
                ValidacionesAccidentes.pintarNegro(txtTipo);
                ValidacionesAccidentes.pintarNegro(txtModelo);
                ValidacionesAccidentes.pintarNegro(txtPlaca);
                ValidacionesAccidentes.pintarNegro(txtCapacidad);
                ValidacionesAccidentes.pintarNegro(txtMarca);
                ValidacionesAccidentes.pintarNegro(txtConductor);
                ValidacionesAccidentes.pintarNegro(txtNumeroInterno);
            }
            valida = false;
        }


    }//GEN-LAST:event_btnIngresarVehiculoActionPerformed
//______________________________________________________________________________

    private void btnEliminarVehiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarVehiculoActionPerformed

        eliminarVehiculo();

    }//GEN-LAST:event_btnEliminarVehiculoActionPerformed
//______________________________________________________________________________

    private void btnModificarVehiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarVehiculoActionPerformed

        btnModificar();

    }//GEN-LAST:event_btnModificarVehiculoActionPerformed
//______________________________________________________________________________

    private void btnAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarActionPerformed

        String nuevoPropietario, nuevoSoat, nuevaRuta, nuevoTipo, nuevoModelo, nuevaPlaca, nuevaCapacidad, nuevaMarca, nuevoConductor, nuevoNumeroInterno;
        nuevoPropietario = txtNuevoPropietario.getText();
        nuevoSoat = txtNuevoSoat.getText();
        nuevaRuta = txtNuevaRuta.getText();
        nuevoTipo = txtNuevoTipo.getText();
        nuevoModelo = txtNuevoModelo.getText();
        nuevaPlaca = txtNuevaPlaca.getText();
        nuevaCapacidad = txtNuevaCapacidad.getText();
        nuevaMarca = txtNuevaMarca.getText();
        nuevoConductor = txtNuevoConductor.getText();
        nuevoNumeroInterno = txtNuevoNumeroInterno.getText();
        boolean valida = true;

        while (valida) {
            if (ValidacionesVehiculo.validaPropietario(nuevoPropietario, txtNuevoPropietario) || ValidacionesVehiculo.validaNumero(nuevoSoat, txtNuevoSoat) || ValidacionesVehiculo.validaRuta(nuevaRuta, txtNuevaRuta)
                    || ValidacionesVehiculo.validaTipo(nuevoTipo, txtNuevoTipo) || ValidacionesVehiculo.validaModelo(nuevoModelo, txtNuevoModelo) || ValidacionesVehiculo.validaPlaca(nuevaPlaca, txtNuevaPlaca)
                    || ValidacionesVehiculo.validaCapacidad(nuevaCapacidad, txtNuevaCapacidad) || ValidacionesVehiculo.validaMarca(nuevaMarca, txtNuevaMarca) || ValidacionesVehiculo.validaConductor(nuevoConductor, txtNuevoConductor)
                    || ValidacionesVehiculo.validaNumeroInterno(nuevoNumeroInterno, txtNuevoNumeroInterno)) {
                JOptionPane.showMessageDialog(jPanel9, "Por favor verifique los datos", "Error", JOptionPane.ERROR_MESSAGE);
            } else {
                modificarVehiculo();
                txtNuevoPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevoSoat.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevoTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevoModelo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevaPlaca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevaCapacidad.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevaMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtNuevoNumeroInterno.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            }
            valida = false;
        }

    }//GEN-LAST:event_btnAceptarActionPerformed
//______________________________________________________________________________

    private void SeleccionarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SeleccionarRutaActionPerformed

        new Thread(new hiloRutas()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarRuta.setVisible(false);
        btnRutaDos.setVisible(true);
        tablaRutas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaRutas.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_SeleccionarRutaActionPerformed
//______________________________________________________________________________

    private void SeleccionarTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SeleccionarTipoActionPerformed

        new Thread(new hiloTipos()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarTipo.setVisible(false);
        btnTipoDos.setVisible(true);
        tablaTipos.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaTipos.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_SeleccionarTipoActionPerformed
//______________________________________________________________________________

    private void SeleccionarMarcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SeleccionarMarcaActionPerformed

        new Thread(new hiloMarcas()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarMarca.setVisible(false);
        btnMarcaDos.setVisible(true);
        tablaMarcas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaMarcas.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_SeleccionarMarcaActionPerformed
//______________________________________________________________________________

    private void SeleccionarConductorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SeleccionarConductorActionPerformed

        new Thread(new hiloConductores()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarConductor.setVisible(false);
        btnConductorDos.setVisible(true);
        tablaConductor.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaConductor.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_SeleccionarConductorActionPerformed
//______________________________________________________________________________

    private void btnRutaDosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRutaDosActionPerformed

        if (tablaRutas.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtNuevaRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 1));
            lblIdRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 0));

            if (txtNuevaRuta.getText().equals("")) {
                txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgRuta.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnRutaDosActionPerformed
//______________________________________________________________________________

    private void btnTipoDosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTipoDosActionPerformed

        if (tablaTipos.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtNuevoTipo.setText("" + tablaTipos.getValueAt(tablaTipos.getSelectedRow(), 1));
            lblIdTipo.setText("" + tablaTipos.getValueAt(tablaTipos.getSelectedRow(), 0));

            if (txtNuevoTipo.getText().equals("")) {
                txtNuevoTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtNuevoTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgTipo.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnTipoDosActionPerformed
//______________________________________________________________________________

    private void btnMarcaDosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMarcaDosActionPerformed

        if (tablaMarcas.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtNuevaMarca.setText("" + tablaMarcas.getValueAt(tablaMarcas.getSelectedRow(), 1));
            lblIdMarca.setText("" + tablaMarcas.getValueAt(tablaMarcas.getSelectedRow(), 0));

            if (txtNuevaMarca.getText().equals("")) {
                txtNuevaMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtNuevaMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgMarca.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnMarcaDosActionPerformed
//______________________________________________________________________________

    private void btnConductorDosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConductorDosActionPerformed

        if (tablaConductor.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtNuevoConductor.setText("" + tablaConductor.getValueAt(tablaConductor.getSelectedRow(), 0));
            lblIdConductor.setText("" + tablaConductor.getValueAt(tablaConductor.getSelectedRow(), 1));

            if (txtNuevoConductor.getText().equals("")) {
                txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgConductor.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnConductorDosActionPerformed
//______________________________________________________________________________

private void btnSeleccionarPropietarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarPropietarioActionPerformed

    new Thread(new hiloPropietarios()).start();
    dlgCargandoDatos.setLocationRelativeTo(null);
    dlgCargandoDatos.setVisible(true);
    btnAceptarPropietario.setVisible(true);
    btnPropietarioDos.setVisible(false);
    tablaPropietario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    tablaPropietario.setAutoCreateRowSorter(true);

}//GEN-LAST:event_btnSeleccionarPropietarioActionPerformed
//______________________________________________________________________________

    private void btnAceptarPropietarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarPropietarioActionPerformed

        if (tablaPropietario.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtPropietario.setText("" + tablaPropietario.getValueAt(tablaPropietario.getSelectedRow(), 0));
            lblIdPropietario.setText("" + tablaPropietario.getValueAt(tablaPropietario.getSelectedRow(), 1));

            if (txtPropietario.getText().equals("")) {
                txtPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgPropietario.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnAceptarPropietarioActionPerformed
//______________________________________________________________________________

    private void txtBuscarVehiculoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscarVehiculoKeyReleased

        llenarVehiculo(txtBuscarVehiculo.getText());

    }//GEN-LAST:event_txtBuscarVehiculoKeyReleased
//______________________________________________________________________________

    private void txtBuscarConductorKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscarConductorKeyReleased

        llenarConductores(txtBuscarConductor.getText());

    }//GEN-LAST:event_txtBuscarConductorKeyReleased
//______________________________________________________________________________

    private void txtBuscarPropietarioKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscarPropietarioKeyReleased

        llenarPropietarios(txtBuscarPropietario.getText());

    }//GEN-LAST:event_txtBuscarPropietarioKeyReleased
//______________________________________________________________________________

    private void btnPropietarioDosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPropietarioDosActionPerformed

        if (tablaPropietario.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtPropietario.setText("" + tablaPropietario.getValueAt(tablaPropietario.getSelectedRow(), 0));
            lblIdPropietario.setText("" + tablaPropietario.getValueAt(tablaPropietario.getSelectedRow(), 1));

            if (txtNuevoPropietario.getText().equals("")) {
                txtNuevoPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgPropietario.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnPropietarioDosActionPerformed
//______________________________________________________________________________

    private void SeleccionarPropietarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SeleccionarPropietarioActionPerformed

        new Thread(new hiloPropietarios()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarPropietario.setVisible(false);
        btnPropietarioDos.setVisible(true);
        tablaPropietario.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaPropietario.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_SeleccionarPropietarioActionPerformed
//______________________________________________________________________________

    private void cbxFiltrarPropietarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbxFiltrarPropietarioActionPerformed

        int Valor = cbxFiltrarPropietario.getSelectedIndex();

        if (Valor == 0) {
            txtBuscarPropietario.setText("");
            llenarPropietarios("");
        } else if (Valor == 1) {
            txtBuscarPropietario.setText("");
            llenarPropietarios("");
        }

    }//GEN-LAST:event_cbxFiltrarPropietarioActionPerformed
//______________________________________________________________________________

    private void cbxFiltrarConductorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbxFiltrarConductorActionPerformed

        int Valor = cbxFiltrarConductor.getSelectedIndex();

        if (Valor == 0) {
            txtBuscarConductor.setText("");
            llenarConductores("");
        } else if (Valor == 1) {
            txtBuscarConductor.setText("");
            llenarConductores("");
        }

    }//GEN-LAST:event_cbxFiltrarConductorActionPerformed
//______________________________________________________________________________
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Buscar;
    private javax.swing.JButton SeleccionarConductor;
    private javax.swing.JButton SeleccionarMarca;
    private javax.swing.JButton SeleccionarPropietario;
    private javax.swing.JButton SeleccionarRuta;
    private javax.swing.JButton SeleccionarTipo;
    private javax.swing.JButton btnAceptar;
    private javax.swing.JButton btnAceptarConductor;
    private javax.swing.JButton btnAceptarMarca;
    private javax.swing.JButton btnAceptarPropietario;
    private javax.swing.JButton btnAceptarRuta;
    private javax.swing.JButton btnAceptarTipo;
    private javax.swing.JButton btnConductorDos;
    private javax.swing.JButton btnEliminarVehiculo;
    private javax.swing.JButton btnIngresarVehiculo;
    private javax.swing.JButton btnMarcaDos;
    private javax.swing.JButton btnModificarVehiculo;
    private javax.swing.JButton btnPropietarioDos;
    private javax.swing.JButton btnRutaDos;
    private javax.swing.JButton btnSeleccionarConductor;
    private javax.swing.JButton btnSeleccionarMarca;
    private javax.swing.JButton btnSeleccionarPropietario;
    private javax.swing.JButton btnSeleccionarTipo;
    private javax.swing.JButton btnSelecionarRuta;
    private javax.swing.JButton btnTipoDos;
    private javax.swing.JButton btnVerTablaVehiculo;
    private javax.swing.JComboBox cbxFiltrarConductor;
    private javax.swing.JComboBox cbxFiltrarPropietario;
    private javax.swing.JComboBox cbxFiltrarVehiculo;
    private javax.swing.JDialog dlgCargandoDatos;
    private javax.swing.JDialog dlgConductor;
    private javax.swing.JDialog dlgMarca;
    private javax.swing.JDialog dlgModificarVehiculo;
    private javax.swing.JDialog dlgPropietario;
    private javax.swing.JDialog dlgRuta;
    private javax.swing.JDialog dlgTablaVehiculo;
    private javax.swing.JDialog dlgTipo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JLabel lblIdConductor;
    private javax.swing.JLabel lblIdMarca;
    private javax.swing.JLabel lblIdPropietario;
    private javax.swing.JLabel lblIdRuta;
    private javax.swing.JLabel lblIdTipo;
    private javax.swing.JLabel lblPlaca;
    private javax.swing.JProgressBar pbCargarDatos;
    private javax.swing.JTable tablaConductor;
    private javax.swing.JTable tablaMarcas;
    private javax.swing.JTable tablaPropietario;
    private javax.swing.JTable tablaRutas;
    private javax.swing.JTable tablaTipos;
    private javax.swing.JTable tablaVehiculo;
    private javax.swing.JTextField txtBuscarConductor;
    private javax.swing.JTextField txtBuscarPropietario;
    private javax.swing.JTextField txtBuscarVehiculo;
    private javax.swing.JTextField txtCapacidad;
    private javax.swing.JTextField txtConductor;
    private javax.swing.JTextField txtMarca;
    private javax.swing.JTextField txtModelo;
    private javax.swing.JTextField txtNuevaCapacidad;
    private javax.swing.JTextField txtNuevaMarca;
    private javax.swing.JTextField txtNuevaPlaca;
    private javax.swing.JTextField txtNuevaRuta;
    private javax.swing.JTextField txtNuevoConductor;
    private javax.swing.JTextField txtNuevoModelo;
    private javax.swing.JTextField txtNuevoNumeroInterno;
    private javax.swing.JTextField txtNuevoPropietario;
    private javax.swing.JTextField txtNuevoSoat;
    private javax.swing.JTextField txtNuevoTipo;
    private javax.swing.JTextField txtNumeroInterno;
    private javax.swing.JTextField txtPlaca;
    private javax.swing.JTextField txtPropietario;
    private javax.swing.JTextField txtRuta;
    private javax.swing.JTextField txtSoat;
    private javax.swing.JTextField txtTipo;
    // End of variables declaration//GEN-END:variables
}
